package com.netcracker.lab1.controller;

import com.netcracker.lab1.model.AbstractGenreManager;
import com.netcracker.lab1.model.Genre;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: nocturne
 * Date: 14.01.13
 * Time: 21:21
 * To change this template use File | Settings | File Templates.
 */
public class GengeControler {

    private AbstractGenreManager gm = null;

    GengeControler(){
        //gm = new GenreManager();
        gm = AbstractGenreManager.getInstance("");
    }

    public Genre createGenre(Integer id, String genreName) {
        return gm.createGenre(id, genreName);
    }

    public Genre findGenreName(Integer id) {
        return gm.findGenreName(id);
    }

    public void deleteGenreById(Integer id) {
        gm.deleteGenreById(id);
    }

    public void saveGenres(String path) throws FileNotFoundException, IOException {
        gm.saveGenres(path);
    }

    public void openGenres(String path) throws FileNotFoundException, IOException, ClassNotFoundException {
        gm.openGenres(path);
    }

    public void editGenre(Integer id, String genreName) {
        gm.editGenre(id, genreName);
    }

    public int getSizeGenres() {
        return gm.getSizeGenres();
    }




}
